/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Salesman;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Ronny
 */
public class Route {

    List<City> cities = new ArrayList<City>();

    public Route() {
    }

    public Route(City c1, City c2) {
        cities.add(c1);
        cities.add(c2);
    }

    public int length() {
        return cities.size();
    }

    public City head() {
        if (cities.isEmpty()) return null;
        return cities.get(0);
    }

    public City tail() {
        if (cities.isEmpty()) return null;
        return cities.get(cities.size()-1);
    }

    public List<City> cities() {
        return cities;
    }
}
